@extends('layouts.mobile_main')

@section('title', '支付密码')

@section('resources')
    @parent
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link rel="stylesheet" href="{{ env('CSS_DOMAIN') }}/css/public.css?v={{env('CSS_VERSION')}}">
    <link rel="stylesheet" href="{{env('CSS_DOMAIN')}}/css/check.css?v={{env('CSS_VERSION')}}">
    <script src="{{ env('JS_DOMAIN') }}/js/adaptation.js?v={{env('JS_VERSION')}}"></script>
@endsection

@section('content')
<div class="paysu_outer">
	<header class="pay_sure oh" style="background-color: #fff;">
		<a class="fl" href="javascript:history.go(-1);"><img class="fl" src="{{env('IMAGE_DOMAIN')}}/images/back_p.png?v={{env('IMAGE_VERSION')}}" alt=""></a>
		<span class="fl co_violet fz_48">支付密码</span>
	</header>
	<ul class="pay_password">
		<li class="pr">
			<span class="fz_44 fl">支付密码</span>
			<div class="slideThree" style="position: absolute;top: -0.35rem;right: 1rem;">
				<input type="checkbox" value="None" id="slideThree" name="check" checked />
				<!--<label for="slideThree" style="position:absolute; left: 0.6rem"></label>-->
				<label for="slideThree"></label>
			</div>
		</li>
		<a href="/mobile/mycenter/password/reset">
			<li class="pay_password_again" style="display:none;">
				<span class="fz_44 fl">重置支付密码</span>
				<img class="fr" src="{{env('IMAGE_DOMAIN')}}/images/go_g.png?v={{env('IMAGE_VERSION')}}" alt="">
			</li>
		</a>
	</ul>
</div>
@endsection
@section('scriptResources')
    @parent
    <script>
        window.onresize=function(){
            pagesp();
        }
        $(function(){
            var paysu_outer_h=$(window).height();
            var pay_password = '{{$paypassword}}';//是否有支付密码
            var is_identity = '{{$isidentity}}';//是否身份认证
            $(".paysu_outer").css({"min-height":paysu_outer_h});

            if(pay_password == 0){//关
                $(".slideThree").css("background","#CDCDCD");
                $(".pay_password_again").hide();
                $(".slideThree label").css("left","0");
            }else{//开
                //$(".slideThree").css("background","#CDCDCD");
                //$(".pay_password_again").hide();
                $(".slideThree").css("background","#9a54c6");
                $(".pay_password_again").show();
                $(".slideThree label").css("left","0.6rem");
            }

            //这部分暂时这样处理
            $(".slideThree input").click(function(){
                var local=$(".slideThree label").position().left;
                // alert(local)
                if(local!=0){//关
                    $(".slideThree").css("background","#CDCDCD");
                    $(".pay_password_again").hide();
                    $(".slideThree label").css("left","0");
                    //alert('1');
                    //关密码的时候，需要输入原密码进行验证
                    window.location.href = '/mobile/mycenter/password/set?type=delete';
                }else{//开
                    //alert('0');
                    if(is_identity == 0) {
                        //跳转到实名认证
                        window.location.href = '/mobile/mycenter/account/auth';
                    } else {
                        //打开密码的时候，跳转到输入密码的页面
                        window.location.href = '/mobile/mycenter/password/set?type=add';
                        //$(".slideThree").css("background","#9a54c6");
                        //$(".pay_password_again").show();
                        //$(".slideThree label").css("left","0.6rem");
                    }
                }
            })
        })
    </script>
@endsection